import request from '../utils/request.ts'
export default {
    getAddArticleNum(){
        return request.get('/client/user/article/addArticleNum')
    },
    getPublishList(data:any) {
        return request.get('/client/user/article/publishList',{params:data})
    },
    deleteArticle(id:number){
        return request.delete('/client/user/article/' + id)
    },
    getDraftList(data:any){
        return request.get('/client/user/article/draftList',{params:data})
    },
    deleteCollect(id:number){
        return request.delete('/client/user/collect/' + id)
    },
    deleteHistory(id:number){
      return request.delete('/client/user/history/' + id)
    },
    getCollectList(data:any){
        return request({
            url: '/client/user/article/collectArticle',
            method: 'get',
            params:data
        })
    },
    getHistoryList(data:any){
      return request({
          url: '/client/user/article/historyArticle',
          method: 'get',
          params:data
      })
    },
    collectArticle(collect:any,isCollect:boolean){
        console.log(collect)
        return request.post('/client/user/collect', collect)
    },
    likeArticle(like:any){
        return request.post('/client/user/like',like)
    },
    getArticlePage(params:any){
        return request({
            url: '/client/user/article/list1',
            method: 'get',
            params
        })
    },
    getInfo(id:number,url:string) {
        return request({
            url: '/client/user/article/client/'+ id +'?url=' + url,
            method: 'get'
        })
    },
    saveArticle(data:any){
        return request({
            url: '/client/user/article',
            method: 'post',
            data
        })
    }
}
